package com.itheima.ydd.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer errno; //200表示成功 0表示失败

    private String errmsg; //信息

    private Object data; //数据



    public static  Result ok(String msg,Object data) {
        return new Result(0,msg,data);
    }

    public static  Result error(String msg) {
        return new Result(1,msg,null);
    }

}
